<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../vue.js"></script>
</head>
<body>
    <div id="app">
        <!-- 容器，vue的代码都放在里面 -->
        <p>商品名称：{{name}}</p>
        <p>商品单价：{{price}}</p>
        <p>商品数量：<input type="text" v-model="num"></p>
        <hr>
        <p>总计：{{price * num}}</p>
    </div>
    <script>
        let vm = new Vue({
            el: '#app',
            data: {
                name: 'iphone',
                price: 4999,
                num: 2
            }
        })
    </script>
</body>
</html>